
/**用户相关的接口*/

let userModel = require(".././models/user");
var { globalCode } = require("../config/globalCode");


const userApi = {

  //获取用户信息

  getUserInfo: (req, res) => {
    let uid = req.query.uid;
    if (!uid) {
      res.send({
        return: globalCode.M_PARAMS_ERROR
      });
      return;
    }
    async function getInfo() {
      let userInfo = await userModel(uid);
      res.send({
        return: globalCode.SUCCESS,
        data: userInfo
      });
    }
    getInfo();
  },

  //示例接口

  testApi: (req, res) => {
    res.send({
      return: globalCode.SUCCESS
    });
  }
}

module.exports = userApi;
